Skip to content

Conversation

@aattola
Copy link
Contributor

@aattola aattola commented Jun 5, 2025

Summary:

PR #51078 Implemented finding disabled libraries but the code (below) didn't actually filter any libraries out because destructured name is undefined. This pr adds the name to codegenEnabledLibraries so filtering would work.

const libraries = codegenEnabledLibraries.filter(
  ({name}) => !disabledLibraries.includes(name),
);

Changelog:

[IOS] [FIXED] - Skip codegen for selectively disabled libraries in react-native.config.js

Test Plan:

  1. Install a library that has the componentProvider field set in the codegen config (for example: react-native-safe-area-context and react-native-screens or see reproducer)
  2. Exclude library with react-native.config.js
  3. install pods / run codegen
  4. Check that codegen actually excluded the specified dependencies from: ios/build/generated/ios/RCTThirdPartyComponentsProvider.mm

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Jun 5, 2025
Copy link

@Hardanish-Singh Hardanish-Singh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@cipolleschi
Copy link
Contributor

can you please open a pick request against 0.79 and 0.80 here. 2 separate issues, one per version, please!

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jun 6, 2025
@facebook-github-bot
Copy link
Contributor

@cipolleschi merged this pull request in 7681036.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @aattola in 7681036

When will my fix make it into a release? | How to file a pick request?

react-native-bot pushed a commit that referenced this pull request Jun 9, 2025
…ion (#51838)

Summary:
PR #51078 Implemented finding disabled libraries but the code (below) didn't actually filter any libraries out because destructured name is `undefined`. This pr adds the name to codegenEnabledLibraries so filtering would work.

```js
const libraries = codegenEnabledLibraries.filter(
  ({name}) => !disabledLibraries.includes(name),
);
```

## Changelog:

[IOS] [FIXED] - Skip codegen for selectively disabled libraries in react-native.config.js

Pull Request resolved: #51838

Test Plan:
1. Install a library that has the componentProvider field set in the codegen config (for example: react-native-safe-area-context and react-native-screens or see [reproducer](https://github.com/aattola/rn-codegen-exclude))
2. Exclude library with react-native.config.js
3. install pods / run codegen
4. Check that codegen actually excluded the specified dependencies from: `ios/build/generated/ios/RCTThirdPartyComponentsProvider.mm`

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76044622

Pulled By: cipolleschi

fbshipit-source-id: 9e70c2a263c750edb1ea95305c9e5e178e2ce8d8
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @aattola in a1bad64

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants